package cn.lngaosu.lwyd.module.integration.dal.mysql.weixinuseranalysis;

import java.util.*;

import cn.lngaosu.lwyd.framework.common.pojo.PageResult;
import cn.lngaosu.lwyd.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.lngaosu.lwyd.framework.mybatis.core.mapper.BaseMapperX;
import cn.lngaosu.lwyd.module.integration.dal.dataobject.weixinuseranalysis.WeixinUserAnalysisDO;
import org.apache.ibatis.annotations.Mapper;
import cn.lngaosu.lwyd.module.integration.controller.admin.weixinuseranalysis.vo.*;

/**
 * 微信用户分析表(增减合计、总用户量) Mapper
 *
 * @author 张恒
 */
@Mapper
public interface WeixinUserAnalysisMapper extends BaseMapperX<WeixinUserAnalysisDO> {

    default PageResult<WeixinUserAnalysisDO> selectPage(WeixinUserAnalysisPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<WeixinUserAnalysisDO>()
                .betweenIfPresent(WeixinUserAnalysisDO::getCreateTime, reqVO.getCreateTime())
                .betweenIfPresent(WeixinUserAnalysisDO::getRefDate, reqVO.getRefDate())
                .eqIfPresent(WeixinUserAnalysisDO::getNewUser, reqVO.getNewUser())
                .eqIfPresent(WeixinUserAnalysisDO::getCancelUser, reqVO.getCancelUser())
                .eqIfPresent(WeixinUserAnalysisDO::getCumulateUser, reqVO.getCumulateUser())
                .orderByDesc(WeixinUserAnalysisDO::getId));
    }

}